<include file="Public:top_frame" />
<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {ace.settings.check('main-container' ,'fixed')}catch(e){}
    </script>

    <include file="Public:left_frame" />

    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <div class="breadcrumbs" id="breadcrumbs">
                <script type="text/javascript">
                    try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
                </script>

                <ul class="breadcrumb">
                    <li>
                        <i class="ace-icon fa fa-home home-icon"></i>
                        <a href="{:U('/index/index')}">首页</a>
                    </li>
                    <li>
                        <a href="{:U('/match/index')}">大赛管理</a>
                    </li>
                    <li class="active">比赛录入</li>
                </ul><!-- /.breadcrumb -->
                <!-- /section:basics/content.searchbox -->
            </div>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <!-- #section:settings.box -->

                <!-- /section:settings.box -->
                <div class="page-header">
                    <h1>
                        比赛录入
                    </h1>
                </div><!-- /.page-header -->
                <div class="row">
                    <div class="col-xs-12">
                        <div class="widget-box">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <!-- #section:plugins/fuelux.wizard -->
                                    <div id="fuelux-wizard-container">
                                        <div class="step-content pos-rel">
                                            <div class="step-pane active" data-step="1">
                                                <form class="form-horizontal" id="validation-form" method="get">
                                                    <div class="form-group">
                                                        <label class="control-label col-xs-12 col-sm-3 no-padding-right" for="name">比赛名称:</label>

                                                        <div class="col-xs-12 col-sm-9">
                                                            <div class="clearfix">
                                                                <input type="text" id="name" name="name" class="col-xs-12 col-sm-5"/>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="space-2"></div>

                                                    <div class="form-group">
                                                        <label class="control-label col-xs-12 col-sm-3 no-padding-right">参赛时间:</label>

                                                        <div class="col-xs-8 col-sm-11">
                                                            <!-- #section:plugins/date-time.datepicker -->
                                                            <div class="input-group">
                                                                <input class="form-control date-picker" id="id-date-picker-1" name= "matchtime" type="text" data-date-format="dd-mm-yyyy" />
																	<span class="input-group-addon">
																		<i class="fa fa-calendar bigger-110"></i>
																	</span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="space-2"></div>

                                                    <div class="form-group">
                                                        <label class="control-label col-xs-12 col-sm-3 no-padding-right" for="matchplace">参赛地点:</label>

                                                        <div class="col-xs-12 col-sm-9">
                                                            <div class="clearfix">
                                                                <input type="text" id="matchplace" name="matchplace" class="col-xs-12 col-sm-5" />
                                                            </div>
                                                        </div>
                                                    </div>



                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="clearfix form-actions">
                                        <div class="col-md-offset-3 col-md-9">
                                            <button class="btn btn-info" type="button" id="match_submit">
                                                <i class="ace-icon fa fa-check bigger-110"></i>
                                                提交
                                            </button>
                                            &nbsp; &nbsp; &nbsp;
                                            <button class="btn" type="reset" id="match_back">
                                                <i class="ace-icon fa fa-undo bigger-110"></i>
                                                返回
                                            </button>
                                        </div>
                                    </div>
                                </div><!-- /.widget-main -->
                            </div><!-- /.widget-body -->
                        </div><!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public:footer" />
</div><!-- /.main-container -->
<!-- basic scripts -->
<!--[if !IE]> -->
<script type="text/javascript">
    window.jQuery || document.write("<script src='__PUBLIC__/admin/assets/js/jquery.js'>"+"<"+"/script>");
</script>
<!-- <![endif]-->
<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='__PUBLIC__/admin/assets/js/jquery1x.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
    if('ontouchstart' in document.documentElement) document.write("<script src='__PUBLIC__/admin/assets/js/jquery.mobile.custom.js'>"+"<"+"/script>");
</script>
<script src="__PUBLIC__/admin/assets/js/bootstrap.js"></script>

<!-- page specific plugin scripts -->
<script src="__PUBLIC__/admin/assets/js/fuelux/fuelux.wizard.js"></script>
<script src="__PUBLIC__/admin/assets/js/jquery.validate.js"></script>
<script src="__PUBLIC__/admin/assets/js/additional-methods.js"></script>
<script src="__PUBLIC__/admin/assets/js/bootbox.js"></script>
<script src="__PUBLIC__/admin/assets/js/jquery.maskedinput.js"></script>
<script src="__PUBLIC__/admin/assets/js/select2.js"></script>
<script src="__PUBLIC__/admin/assets/js/date-time/bootstrap-datepicker.js"></script>
<script src="__PUBLIC__/admin/assets/js/date-time/bootstrap-timepicker.js"></script>
<script src="__PUBLIC__/admin/assets/js/date-time/moment.js"></script>

<!-- ace scripts -->
<script src="__PUBLIC__/admin/assets/js/ace/elements.scroller.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/elements.colorpicker.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/elements.fileinput.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/elements.typeahead.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/elements.wysiwyg.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/elements.spinner.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/elements.treeview.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/elements.wizard.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/elements.aside.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.ajax-content.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.touch-drag.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.sidebar.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.sidebar-scroll-1.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.submenu-hover.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.widget-box.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.settings.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.settings-rtl.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.settings-skin.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.widget-on-reload.js"></script>
<script src="__PUBLIC__/admin/assets/js/ace/ace.searchbox-autocomplete.js"></script>

<!-- inline scripts related to this page -->
<script type="text/javascript">
    jQuery(function($) {

        $('.nav-list li').removeClass('open').removeClass('active');
        $('#left_2').addClass('open').addClass('active');
        $('#left_2_1').addClass('active');


        $('#match_submit').on('click', function() {
            // 比赛名称
            var name = $('#name').val();
            if (name == '') {
                alert('比赛名称不能为空');
                return;
            }


            $.ajax({
                type: "POST",
                dataType: "json",
                data: $("#validation-form").serialize(),
                async: true,
                url: "__URL__/doMatchInput",
                success : function(res) {
                    if (res) {
                        if (res.code == 100) {
                            alert("录入成功");
                            window.location.href = '__URL__/index';
                            return;
                        } else {
                            alert(res.message);
                            return;
                        }
                    } else {
                        alert("录入失败");
                    }
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert("网络异常");
                }
            });

        });

        $('.date-picker').datepicker({
            autoclose: true,
            todayHighlight: true
        })
            //show datepicker when clicking on the icon
                .next().on(ace.click_event, function(){
                    $(this).prev().focus();
                });

        //or change it into a date range picker
        $('.input-daterange').datepicker({autoclose:true});

        $('#match_back').on('click', function() {
            history.back();
        });




        $(document).one('ajaxloadstart.page', function(e) {
            //in ajax mode, remove remaining elements before leaving page
            $('[class*=select2]').remove();
        });
    });
</script>
</body>
</html>